home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Maths & Calculations / counting-how-long-u-on-page.izs < prev    next >
Text File  |  2005-07-20  |  2KB  |  92 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Counting how long one has stayed in your page
  4.  
  5. <!/TITLE>
  6.  
  7. <!DESCRIPTION>The below script will count the number of seconds a person has been to your webpage.
  8. <!/DESCRIPTION> 
  9.  
  10. <!CATEGORY>Counters<!/CATEGORY>
  11.  
  12. <!SCRIPT>
  13. <!-- START OF SCRIPT -->
  14. <!-- Simply cut and paste this script into the <body> tags of your page.  -->
  15. <table border="0">
  16. <tr>
  17. <td align="center"><font face="Arial"><strong>You have
  18. visited my page for:</strong></font></td>
  19. <td align="center"><form name="d">
  20. <p><input type="text" size="8" name="d2"></p>
  21. </form>
  22. </td>
  23. <td align="center"><font face="Arial"><strong>seconds!</strong></font></td>
  24. </tr>
  25. </table>
  26. <script>
  27. <!--
  28. /*By George Chiang. (JK's ultimate JavaScript tutorial and free JavaScripts site!)
  29. http://www.javascriptkit.com
  30. Credit MUST stay intact for use*/
  31. var milisec=0
  32. var seconds=0
  33. document.d.d2.value='0'
  34. function display(){
  35. if (milisec>=9){
  36. milisec=0
  37. seconds+=1
  38. }
  39. else
  40. milisec+=1
  41. document.d.d2.value=seconds+"."+milisec
  42. setTimeout("display()",100)
  43. }
  44. display()
  45. //-->
  46. </script>
  47.  
  48.  
  49. <!-- END OF SCRIPT -->
  50. <!/SCRIPT>
  51.  
  52. <!PREVIEW>
  53. <!-- START OF SCRIPT -->
  54. <!-- Simply cut and paste this script into the <body> tags of your page.  -->
  55. <table border="0">
  56. <tr>
  57. <td align="center"><font face="Arial"><strong>You have
  58. visited my page for:</strong></font></td>
  59. <td align="center"><form name="d">
  60. <p><input type="text" size="8" name="d2"></p>
  61. </form>
  62. </td>
  63. <td align="center"><font face="Arial"><strong>seconds!</strong></font></td>
  64. </tr>
  65. </table>
  66. <script>
  67. <!--
  68. /*By George Chiang. (JK's ultimate JavaScript tutorial and free JavaScripts site!)
  69. http://www.javascriptkit.com
  70. Credit MUST stay intact for use*/
  71. var milisec=0
  72. var seconds=0
  73. document.d.d2.value='0'
  74. function display(){
  75. if (milisec>=9){
  76. milisec=0
  77. seconds+=1
  78. }
  79. else
  80. milisec+=1
  81. document.d.d2.value=seconds+"."+milisec
  82. setTimeout("display()",100)
  83. }
  84. display()
  85. //-->
  86. </script>
  87.  
  88.  
  89. <!-- END OF SCRIPT -->
  90. <!/PREVIEW>
  91.  
  92. <!RELATED>NONE<!/RELATED>